export default async (that)=>{
	return {
		columns:[
			{
				key:"name",
				label:"销售名称"
			},
			{
				key:"createTime",
				label:"创建时间"
			},
			{
				key:"updateTime",
				label:"修改时间"
			},
			{
				key:"operation",
				label:"操作",
				slot:"operation",
				removeBtn:{
					show:true,
					permission:"sales:delete"
				},
				editBtn:{
					show:true,
					permission:"sales:edit"
				},
			}
		],
		reqOptions:{
			list:{
				method:"get",
				url:"/sales"       
			},
			insert:{
				method:"post",
				url:"/sales"
			},
			update:{
				method:"put",
				url:"/sales"
			},
			remove:{
				method:"delete",
				url:"/sales/${id}"
			}
		},
		search:{
			form:{},
			options:[
				{
					key:"name",
					type:"el-input",
					label:"销售名称",
					required:false,
					props:{
						clearable:true
					}
    
				},
				{
					key:"test",
					type:"el-button",
					label:"查询",
					removeLabel:true,
					width:false,
					props:{
						type:"primary",
						// size:"medium"
					},
					listeners:{
						click(...e){
							that.searchFun && that.searchFun instanceof Function && that.searchFun(...e)
							that.$emit("search")
							console.log("click")
							that.getList()
						}
					}
				},
			],
			direction:"h",
			labelPosition:"right"
		},
		operation:{
			form:{},
			direction:"h",
			options:[
				{
					key:"btn1",
					type:"el-button",
					label:"添加",
					width:false,
					removeLabel:true,
					props:{
						type:"primary",
						// size:"medium",
						icon:"el-icon-plus"
					},
					listeners:{
						click:(...e)=>{
							console.log(that)
							that.addFun && that.addFun instanceof Function && that.addFun(...e)
						}
					}
				}
			]
		},
		updateField:async (form={})=>{
			return {
				form,
				direction:"h",
				options:[
					{
						key:"name",
						label:"销售名称",
						type:"el-input",
						required:true
					},
					// {
					// 	key:"isDefault",
					// 	label:"是否默认",
					// 	type:"el-switch",
					// 	props:{
					// 		activeValue:1,
					// 		inactiveValue:0
					// 	}
					// }
                    
				]
			}
		}
        
	}
}